/**
 * 检查格式以及弹出提示等
 *
 * @author winkyle
 * @date 2018/11/15
 */
//获取当前时间
function getTimestamp() {
    var time = new Date();
    return time.getTime();
}
var rockNum = 1;
var timer;
//定时摇晃整界面
function showRockTiming(){
    rockNum = 1;
    //关闭提示晃动屏幕，注释掉这句话即可
    timer = setInterval(rock, 10);
};
var current1 = 0;
var current2 = 1;
//摇晃
function rock(){
    if(rockNum>50){
        document.body.style.transform = 'rotate(0deg)';
        clearInterval(timer);
        return;
    }
    current1 = (current2)%360;
    document.body.style.transform = 'rotate('+current1+'deg)';
    current1 ++;
    if(current2 == 1){current2 = -1;}else{current2 = 1;}
    rockNum++;
};
//提示：弹出提示框组件的id，提示框side，提示框msg，提示框bg，提示框弹出时间
function tips(id,side,msg,bg,time){
    $(id).tips({
        side : side,
        msg : msg,
        bg : bg,
        time : time
    });
    $(id).focus();
}
//数据校验并提示（目前仅检查是否为空）：弹出提示框组件的id，提示框msg
function checkFormat(id,msg) {
    if ($(id).val() == "") {
        tips(id,1,msg,'#AE81FF',3);
        return false;
    }
    return true;
}